package com.yjhb.android.sbz.mvp.chat;

import com.yjhb.android.sbz.http.HttpObserver;
import com.yjhb.android.sbz.http.HttpTool;
import com.yjhb.android.sbz.mvp.ConventionPresenter;

import java.util.Map;

/**
 * 创建者 zx
 * 创建时间 2021/2/27 14:31
 */
public class ChatPresenter extends ConventionPresenter<ChatView> {
    private final String TAG = "ChatPresenter";

    @Override
    protected void onDestroy() {

    }

    public ChatPresenter(ChatView chatView) {
        super(chatView);
    }


    /**
     * 获取自动回复的问题及答案
     */
    public void getProblems() {
        HttpTool.request(model.getAutoReply(), new HttpObserver<Map<String, String>>() {
            @Override
            public void onResult(Map<String, String> data) {
                if (view!=null){
                    view.onProblems(data);
                }
            }

            @Override
            public void onError(int code, String msg) {

            }
        });
    }

}
